
package main

import (
	"fmt"
	"bufio"
	"log"
	"os"
	"strconv"
	)

func main(){
	fmt.Println("switch example start")
	
	running:=true
	reader:=bufio.NewReader(os.Stdin)
	for running {
		data,_,_:=reader.ReadLine();
		command:=string(data)
		switch command{
			case "stop":
			running=false
			case "mary" , "jack" , "tom":
			log.Println("-------------------",command)
		}
		log.Println("command",command)
	}
	
	running=true
	fmt.Println("input number ")
	for running {
		data,_,_:=reader.ReadLine()
		fmt.Println("read--->",data)
		number,_:=strconv.ParseInt(string(data),0,0)
		fmt.Println("you input is ",number)
		switch{
			case number<0: 
			log.Println("less than 0")
			case number>0 && number<10:
			log.Println("bigger than 0 but less than 10")
			case number>10 && number<100:
			log.Println("bigger than 10 but less than 100")
			case number>100:
			log.Println("bigger than 100")
		}
	}
	
	fmt.Println("switch example  end ")
}